<?xml version="1.0"  encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<%@ taglib uri="/tags/jstl-fmt" prefix="fmt" %>
<%@ taglib uri="/tags/jstl-core" prefix="c" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>

<html xmlns="http://www.w3.org/1999/xhtml">

  <head>
    
    <title><fmt:message key="Lista.Title"/></title>
    
    <meta http-equiv="Content-Type" content="application/xhtml+xml" />
	<meta http-equiv="pragma" content="no-cache"/>	
	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="0"/>    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
	<meta http-equiv="description" content="This is my page"/>
	
	<link href="./css/main.css" rel="stylesheet" type="text/css"/>

  </head>
  
  <body>

  <p><img class="cabecera" src="img/logo.gif" alt="<fmt:message key="Wap.Logo"/>"/></p>
  
  <h1><fmt:message key="Lista.Head"/></h1>
<!-- inicio = 0 to numCanciones-tamPag -->
  <c:set var="inicio" value="${(param.p-1) * tamPag}"/>
<!-- fin = tampag to numcanciones -->
  <c:set var="fin" value="${(param.p-1) * tamPag + tamPag -1}"/>
  
  <p class="n_pagina"><fmt:message key="Lista.Paginacion">
         <fmt:param value="${param.p}"/>
         <fmt:param value="${numPag}"/>
      </fmt:message>
   </p>
  
  <ol start="<c:out value="${inicio+1}"/> >
  <!--begin="${(param.p-1) * tamPag +1}" end="${(param.p-1) * tamPag + tamPag}"-->
  <c:forEach items="${applicationScope.canciones}" var="cancion"
    begin="${inicio}" end="${fin}">
  	<li>
	<c:url var="urlForm" value="formAltaPeticion.do">
		<c:param name="idcancion" value="${cancion.id}"/>
		<c:param name="titulo" value="${cancion.titulo}"/>
		<c:param name="autor" value="${cancion.autor}"/>
	</c:url>
	  <a href="<c:out value='${urlForm}'/>" class="elemento_lista"><c:out value="${cancion.autor} - ${cancion.titulo}"/></a><br/>
	</li>
  </c:forEach>
  </ol>
  
  <p>
	<c:if test="${param.p>1}">
		<c:url var="urlListaAnt" value="/listaCanciones.do">
			<c:param name="p"   value="${param.p-1}" />
		</c:url>
		<a href="<c:out value="${urlListaAnt}"/>" class="elige_pagina"><fmt:message key="Actions.Wap.Ant"/></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	</c:if>
	<c:if test="${param.p<numPag}">
		<c:url var="urlListaSig" value="/listaCanciones.do">
            <c:param name="p"   value="${param.p+1}" />
        </c:url>
        <a href="<c:out value="${urlListaSig}"/>" class="elige_pagina"><fmt:message key="Actions.Wap.Sig"/></a>
	</c:if>
  </p>

  <p><a href="inicio.do" class="volver"><fmt:message key="Actions.Wap.Volver"/></a></p>

  </body>
</html>
